﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;

namespace MMITIntegration.Helpers
{
    public static class Sha256EncryptHelper
    {
        private static string hash = string.Empty;

        public static string Encrypt(string token)
        {
            byte[] inputBytes = Encoding.UTF8.GetBytes(token);
            byte[] hashedBytes = (new SHA256CryptoServiceProvider()).ComputeHash(inputBytes);
            hash = BitConverter.ToString(hashedBytes).Replace("-", string.Empty).ToLower();

            return hash;
        }
    }
}